package com.spring.event;

import org.springframework.context.ApplicationListener;

/**
 * 事件监听器，负责监听MailSendEvent事件
 */
public class MailSendListener implements ApplicationListener<MailSendEvent> {

    //对MailSendEvent事件进行处理
    @Override
    public void onApplicationEvent(MailSendEvent mailSendEvent) {
        System.out.println("MailSendListener监听到：向" + mailSendEvent.getTo() + "发送了一份邮件！！");
    }
}
